<template>
    <div>
        <!--轮播图-->
        <mt-swipe :auto="4000">
            <mt-swipe-item v-for="(img,index) in imgs" :key="index">
                <a :href="img.url">
                    <img :src="img.img">
                </a>
            </mt-swipe-item>
        </mt-swipe>
        <!-- home九宫格 -->
        <div class="mui-content">
            <ul class="mui-table-view mui-grid-view mui-grid-9">
                <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
                    <!-- 1：去哪里 -->
                    <router-link :to="{name:'news.list'}">
                        <span class="mui-icon mui-icon-home"></span>
                        <div class="mui-media-body">新闻资讯</div>
                    </router-link>
                </li>
                <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3"><a href="#">
                    <router-link :to="{name:'photo.share'}">
                        <span class="mui-icon mui-icon-email"></span>
                        <div class="mui-media-body">图文分享</div>
                    </router-link>
                </a></li>
                <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3"><a href="#">
                    <router-link :to="{name:'goods.list'}">
                        <span class="mui-icon mui-icon-chatbubble"></span>
                        <div class="mui-media-body">商品展示</div>
                    </router-link>
                </a></li>
                <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3"><a href="#">
                    <span class="mui-icon mui-icon-location"></span>
                    <div class="mui-media-body">留言反馈</div>
                </a></li>
                <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3"><a href="#">
                    <span class="mui-icon mui-icon-search"></span>
                    <div class="mui-media-body">搜索资讯</div>
                </a></li>
                <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3"><a href="#">
                    <span class="mui-icon mui-icon-phone"></span>
                    <div class="mui-media-body">联系我们</div>
                </a></li>
            </ul>
        </div>
    </div>
</template>

<script>
    export default {
        name: "home",
        data() {
            return {
                imgs: [
                    {
                        img: 'http://img1.imgtn.bdimg.com/it/u=3873040750,1105020127&fm=27&gp=0.jpg',
                        url: 'http://image.baidu.com/search/detail?ct=503316480&z=undefined&tn=baiduimagedetail&ipn=d&word=%E5%9B%BE%E7%89%87&step_word=&ie=utf-8&in=&cl=2&lm=-1&st=undefined&cs=1614455141,2952757874&os=3644549776,2227766643&simid=4165481643,755285963&pn=8&rn=1&di=95850905150&ln=1865&fr=&fmq=1538967806658_R&fm=&ic=undefined&s=undefined&se=&sme=&tab=0&width=undefined&height=undefined&face=undefined&is=0,0&istype=0&ist=&jit=&bdtype=0&spn=0&pi=0&gsm=0&objurl=http%3A%2F%2Fpic.58pic.com%2F58pic%2F15%2F63%2F07%2F42Q58PIC42U_1024.jpg&rpstart=0&rpnum=0&adpicid=0'
                    },
                    {
                        img: 'http://pic29.nipic.com/20130511/9252150_174018365301_2.jpg',
                        url: 'http://image.baidu.com/search/detail?ct=503316480&z=undefined&tn=baiduimagedetail&ipn=d&word=%E5%9B%BE%E7%89%87&step_word=&ie=utf-8&in=&cl=2&lm=-1&st=undefined&cs=3033257042,4077893909&os=202457079,2845090577&simid=4218142832,648039820&pn=9&rn=1&di=126619710030&ln=1865&fr=&fmq=1538967806658_R&fm=&ic=undefined&s=undefined&se=&sme=&tab=0&width=undefined&height=undefined&face=undefined&is=0,0&istype=0&ist=&jit=&bdtype=0&spn=0&pi=0&gsm=0&objurl=http%3A%2F%2Fpic.58pic.com%2F58pic%2F15%2F57%2F84%2F70H58PICCJt_1024.jpg&rpstart=0&rpnum=0&adpicid=0'
                    },
                    {
                        img: 'http://img0.imgtn.bdimg.com/it/u=2882284884,1913504836&fm=27&gp=0.jpg',
                        url: 'http://image.baidu.com/search/detail?ct=503316480&z=undefined&tn=baiduimagedetail&ipn=d&word=%E5%9B%BE%E7%89%87&step_word=&ie=utf-8&in=&cl=2&lm=-1&st=undefined&cs=1654937742,1393289912&os=94984510,37653541&simid=3421137387,542468732&pn=32&rn=1&di=153549627440&ln=1865&fr=&fmq=1538967806658_R&fm=&ic=undefined&s=undefined&se=&sme=&tab=0&width=undefined&height=undefined&face=undefined&is=0,0&istype=0&ist=&jit=&bdtype=0&spn=0&pi=0&gsm=0&objurl=http%3A%2F%2Fpic22.nipic.com%2F20120621%2F1628220_155636709122_2.jpg&rpstart=0&rpnum=0&adpicid=0'
                    }
                ],//轮播图列表
            }
        },
        created() {
            //发起请求
            // this.ajax.get('getlunbo')
            //     .then(res => {
            //         console.log(res.data.message)
            //         this.imgs = res.data.message;
            //     })
        }
    }
</script>

<style scoped>


    /*九宫格样式*/
    .mui-table-view.mui-grid-view.mui-grid-9 {
        background-color: white;
        border: 0;
        margin-top: 0px;
    }

    .mui-table-view.mui-grid-view.mui-grid-9 li {
        border: 0;
    }

    /*九宫格清除字体图标*/
    .mui-icon-home:before,
    .mui-icon-email:before,
    .mui-icon-chatbubble:before,
    .mui-icon-location:before,
    .mui-icon-search:before,
    .mui-icon-phone:before {
        content: '';
    }

    /*九宫格背景图片   background-repeat: round;//自动环绕*/
    .mui-icon-home {
        background-image: url('../../static/img/news.png');
        background-repeat: round;
    }

    .mui-icon-email {
        background-image: url('../../static/img/picShare.png');
        background-repeat: round;
    }

    .mui-icon-chatbubble {
        background-image: url('../../static/img/goodShow.png');
        background-repeat: round;
    }

    .mui-icon-location {
        background-image: url('../../static/img/feedback.png');
        background-repeat: round;
    }

    .mui-icon-search {
        background-image: url('../../static/img/search.png');
        background-repeat: round;
    }

    .mui-icon-phone {
        background-image: url('../../static/img/callme.png');
        background-repeat: round;
    }

    /*九宫格图标宽高*/
    .mui-icon {
        height: 50px;
        width: 50px;
    }
</style>